﻿<template>
  <div class="info-card" ref="cardRef">
    <div class="info-card-head">
      <div class="info-card-head-circle">
        <div class="info-card-head-circle-small"></div>
      </div>
      <span class="info-card-head-title">{{ title }}</span>

      <div class="info-card-head-right">
        <slot name="right"></slot>
      </div>
    </div>
    <div class="info-card-content">
      <slot></slot>
    </div>
  </div>
</template>

<script setup>
  const props = defineProps({
    title: { type: String, default: "" },
  });
  const cardRef = ref();
  const getTop = () => {
    return cardRef.value;
  };
  defineExpose({
    getTop,
  });
</script>

<style lang="scss" scoped>
  .info-card {
    border-radius: 12px;
    border: 1px solid var(--fl7);
    margin-top: 12px;

    .info-card-head {
      display: flex;
      align-items: center;
      position: relative;
      padding: 24px;
      background: linear-gradient(175deg, var(--bd9) 5.9%, var(--fl7) 40.79%);
      border-radius: 12px 12px 0 0;

      .info-card-head-circle {
        position: relative;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background-color: var(--bd7);
        margin-left: 5px;
        margin-right: 8px;
        .info-card-head-circle-small {
          width: 14px;
          height: 14px;
          border-radius: 50%;
          position: absolute;
          top: -5px;
          left: -5px;
          background: linear-gradient(130.6deg, var(--bd7) 0.82%, var(--bd) 94.23%);
        }
      }
      .info-card-head-title {
        color: var(--ct1);
        font-size: 18px;
        font-weight: bold;
      }
      .info-card-head-right {
        position: absolute;
        top: 24px;
        right: 24px;
      }
    }
    .info-card-content {
      padding: 0 24px 24px 24px;
      background-color: var(--fl7);
    }
  }
</style>
